Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — GitLab watches can now report a retry that fails again even when its pipeline URL stays unchanged. The change is limited to existing watch notifications, with optional metadata and URL fallback preserving other providers’ behavior. You can add or adjust custom eligibility rules. Learn more. |
|
This PR conflicts with See the conflict window. |
GitLab reports a merge request's head pipeline as one check whose URL is the pipeline's. Retrying failed jobs reruns them inside that pipeline, so the URL never changes and the watch's name-plus-URL run key cannot tell a retry that failed again from the failure it already told. Checks gain an optional runId for hosts whose check URL survives a rerun. The watch keys failed runs on runId, falling back to the URL. GitLab sets it to the pipeline ID and its finish time, which moves each time the pipeline finishes again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5448caf to
8b2e312
Compare
|
This PR conflicts with See the conflict window. |
Stacked on #32319, targeting its branch: a follow-up for the GitLab case reported in #32277 (comment).
Problem
#32319 tells a rerun that failed again apart by the check's name and URL. GitLab reports a merge request's head pipeline as one
Pipelinecheck whose URL is the pipeline'sweb_url. Retrying failed jobs reruns them inside the same pipeline, so the URL never changes, and a retry that fails between two watch reads still matches the run the watch already told. The watch stays silent.Seen on a live merge request: three retried jobs failed within 12 seconds, the pipeline went
runningtofailedbetween two sweeps, and the watch never woke the agent again.Change
PullRequestCheckgains an optionalrunIdfor hosts whose check URL survives a rerun.runId, falling back to the URL as before.runIdto the pipeline ID and itsfinished_at, which moves each time the pipeline finishes again. A running pipeline (no finish time yet) or one without an ID carries none, so it keys on the URL as in fix(server): PR watches report reruns that fail again and failed runs another GitHub event hides #32319.Watches saved before #32319 have no
failedRunsand compare by name on their first read, so landing both together causes no repeat wakes.Verification
apps/server:vp test run src/orchestration-v2/pullRequestWatch.test.tspasses, 24 tests. The new case fails with the run key reverted to the URL alone.packages/source-control-gitlab:gitLabMergeRequestJson.test.tsandGitLabPullRequestCli.test.tspass, 168 tests. The new case usesfinished_atvalues in the shape a realhead_pipelinereturns.vp fmt --checkis clean on the changed files. Typecheck ofcontracts,source-control-gitlabandapps/serverprinted no errors, only suggestions already present in files this change does not touch.Other hosts that report one check per pipeline (Bitbucket, Azure DevOps, Forgejo) may have the same gap; this change leaves them on the URL.
🤖 Generated with Claude Code